/*
 * @lc app=leetcode.cn id=1619 lang=javascript
 *
 * [1619] 删除某些元素后的数组均值
 */

// @lc code=start
/**
 * @param {number[]} arr
 * @return {number}
 */
var trimMean = function (arr) {
  arr.sort((a, b) => a - b);
  let len = arr.length;
  let sum = 0;
  for (let i = len / 20; i < len - (len / 20); i++) {
    sum += arr[i];
  }
  console.log(sum);
  return sum / (len * 0.9);
};
// @lc code=end

